package org.brownflat.watergate.job;

import org.apache.log4j.Logger;
import org.brownflat.watergate.service.ReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>&copy Rupert Jones 2012</p>
 *
 * @author rup
 */
@Component
@Transactional
public class TriggerReviewsJob implements Runnable {

    private static final Logger LOG = Logger.getLogger(TriggerReviewsJob.class);

    @Autowired
    private ReviewService reviewService;

    @Override
    public void run() {
        LOG.info("Looking for commits to generate reviews...");
        reviewService.generateReviewsFromCommits();
        LOG.info("Finished looking for commits to generate reviews.");
    }
}
